package bigbrother.log.logentries;

import bigbrother.ParameterChecker;
import org.joda.time.DateTime;

/**
 * {@link LogEntry} for emotes or actions (e.g. /me nods).
 *
 * @author Hans Haggstrom
 */
public final class ActionEntry
        extends AbstractLogEntry
{

    //======================================================================
    // Private Fields

    private final String myAction;

    //======================================================================
    // Public Methods

    //----------------------------------------------------------------------
    // Constructors

    public ActionEntry( final DateTime timeStamp,
                        final String nick,
                        final String channel,
                        final String action )
    {
        super( timeStamp, nick, channel );

        ParameterChecker.checkNotNull( action, "action" );

        myAction = action;
    }

    //----------------------------------------------------------------------
    // LogEntry Implementation


    public String getAsString()
    {
        return getNick() + " " + myAction;
    }

}
